<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
     <meta content="telephone=no" name="format-detection" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable = no"/>
    <title>订单列表-{$webseting.web_title}</title>
    <link href="__PUBLIC__/wap/css/rest.css"  rel="stylesheet">
    <link href="__PUBLIC__/wap/css/user.css"  rel="stylesheet">
</head>
<body id="body">
    <header id="header" class="u-header clearfix">
        <div class="u-hd-left f-left">
            <a href="{:U('wap/member/index')}" class="J_backToPrev"><span class="u-icon-px i-hd-back"></span></a>
        </div>
        <div class="u-hd-tit"><span>退货单</span></div>
    </header>
    <div class="common-wrapper">
          <div>
       
    </div>
        <div class="f-nei">
            <ul class="concern-con initHeight more_html">
               <volist name="list" id="vo">
                   <li>

                       <div class="order-title">
                           <h2>订单编号:<span>{$vo.order_sn}</span></h2>

                           <p>申请时间:<span>{$vo.add_time}</span></p>
                       </div>
                         
    							   <a class="" href="{:U('Wap/goodsrefund/index',array('id'=>$vo['order_goods_id']))}">
    							   <span class="p-img"><img
    									   src="{$vo.goods_image}"
    									   alt=""></span>
    								   <span class="p-name">{$vo.goods_name}</span>
    								   <span class="p-price"><span>￥{$vo.goods_price}</span></span>
    							 
    							   </a>
                      
                       <div class="order-button delete_button_c">
                               <a href="{:U('Wap/goodsrefund/index',array('id'=>$vo['order_goods_id']))}" style="float: none;">
                                   {$vo.code_name}
                                    <if condition="$vo.un_read neq 0">
                                        {$vo.un_read}
                                    </if>
                               </a>
                       </div>
                   </li>
               </volist>
            </ul>
        </div>

    </div>
         <div class="b_q">
        <div class="fm-footer-copyright get_more">
            <if condition="$count gt 10 && count($list) eq 10">
                  加载更多
              <else/>  
                 无更多数据
            </if>
        </div>
    </div>
    <div style="height:10px;">
   </div> 
     <!--end top-->
   <include file="Public/footer" />  
     <!--end top-->
       
     <input type="hidden" name="p" value="2" />
     <input type="hidden" name="order_state" value="{$_GET['order_state']}" />
    <input type="hidden" name="order" value=""/>

     <!--微信分享-->    
 <include file="Public/share_weixin" />
  
    <script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script>
 <script type="text/javascript">
     var load_more = 0;
     var load_none = 0;
     $(function () {

         $(window).scroll(function () {
             var scrollTop = $(this).scrollTop();
             var scrollHeight = $(document).height();
             var windowHeight = $(this).height();
             if (scrollTop + windowHeight == scrollHeight) {
                 //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
                 if (load_none != 1) {
                     if (load_more == 1) {
                         var html = ' <img src="__PUBLIC__/wap/img/icon_zhuan.gif" style="max-width:15px;">'
                         $('.get_more').html('加载中' + html);
                     } else {
                         get_more();
                     }
                 }

             }
         });
     })
   $(function(){
     $(".get_more").click(function(){
        get_more();
     });
     $(".oder_state_c li").click(function(){
        
        $('.oder_state_c li').removeClass('curr');
        $(this).addClass('curr');
        var data=$(this).attr('data');
        $("input[name='order_state']").val(data);
        $("input[name='p']").val(1);
        get_more();
     });
     
   }); 
   function get_more(){
       load_more = 1;
       var html = ' <img src="__PUBLIC__/wap/img/icon_zhuan.gif" style="max-width:15px;">'
       $('.get_more').html('加载中' + html);
     var p=$("input[name='p']").val();
      var order_sta=$("input[name='order_state']").val();
           $.ajax({ 
            url: "{:U('wap/goodsrefund/refund_list')}",
            type:'post',
            data: {p:p,order_state:order_sta},
            dataType: 'json',
            success: function(data){
              //console.log(data);
               var con=1;
                var option='';
                if(data){
                      $.each(data, function(i, value) {
                    //this指向当前元素
                    //i表示Array当前下标
                    //value表示Array当前元素order_goods_id
                    var order_state='<div class="order-button"><a href="<?php echo U('Wap/goodsrefund/index');?>?id='
                    +value.order_goods_id+'" style="float: none;">'+value.code_name+'</a></div>';
                      var goods_list = '<a class="" href="<?php echo U('Wap/goodsrefund/index');?>?id='
                                  +value.order_goods_id+'">'
                                  + '<span class="p-img"><img src = "'+value.goods_image+'" alt = "" ></span>'
                                  + '<span class="p-name">'+value.goods_name+'</span>'
                                  + '<span class="p-price"><span>￥'+value.goods_price+'</span></a>';;
                     option=option+' <li>'
                  + '<div class="order-title">'
                  + '   <h2>订单编号:<span>'+value.order_sn+'</span></h2>'
                  + '   <p>申请时间:<span>'+value.add_time+'</span></p>'
                  + '</div>'
                   +goods_list+ order_state
                  +'      </li>';
                        con++;
                     });
                }
                 $('.more_html').append(option);
               /* if(p==1){
                  $('.more_html').html(option);
                }else{
                 
                }*/
                load_more = 0;
                if (option) {
                    $("input[name='p']").val(parseInt(p) + 1);
                }
              if(con<10){
                  load_none = 1;
                 $('.get_more').html('无更多数据');
              }
            }
           });
   }

</script>  
 <script type="text/javascript">
   $(function(){
    //确认收货
   /* $('.more_html').on('click','.delivered_order',function(){
      var __this=$(this);
       var order_id=__this.attr('data');
       alert(order_id);
       layer.confirm('是否确认收货？确认收货后订单不可退换！', {
            btn: ['确定','取消'] //按钮
      }, function(){
          if(order_id){
            $.ajax({
                url: "{:U('wap/goodsorder/order_delivered')}",
                type:'post',
                data: {order_id:order_id},
                dataType: 'json',
                success: function(data){
                  if(data.status==1){
                     var str=$('.oder_state_c .pay_order_n p:eq(0)').html();
                   $('.oder_state_c .pay_order_n p:eq(0)').html(parseInt(str) - 1);
                    var str=$('.oder_state_c .f_order_n p:eq(0)').html();
                     $('.oder_state_c .f_order_n p:eq(0)').html(parseInt(str) + 1);
                    //alert("确认收货成功");
                    layer.msg('确认收货成功', {icon: 6,time: 1500},function(){
                    $("input[name='p']").val(1);
                    get_more();
                    ///刷新页面
                     });
                    //$('.delivered_html').remove();
                  }else{
                    layer.msg(data.error, {icon: 5});
                    //alert(data.error)
                  }
                }
               });
          }else{
             layer.msg('系统繁忙,请稍后再试', {icon: 5});
            //alert('系统繁忙,请稍后再试')
          }

      }, function(){
          
      });

     });*/

});
 </script> 
</body>
</html>